package com.atguigu.gmall.product.mapper;

import com.atguigu.gmall.model.product.BaseCategory1;
import com.atguigu.gmall.model.product.BaseCategoryView;
import com.atguigu.gmall.model.to.CategoryAndChildTo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface BaseCategory1Mapper extends BaseMapper<BaseCategory1> {

    /**
     * 查询分类及其子分类
     * @return
     */
    List<CategoryAndChildTo> getAllCategoryWithChilds();

    /**
     * 查询sku的分类层级
     * @param skuId
     * @return
     */
    BaseCategoryView getSkuCategoryView(@Param("skuId") Long skuId);
}
